package cc.linker.steplink.crm.merchanth5.dao.integral;

import cc.linker.steplink.crm.merchanth5.pojo.ShoppingCartGoodsPo;
import cc.linker.steplink.crm.merchanth5.pojo.integral.IntegralGoodsPo;
import cc.linker.steplink.crm.merchanth5.pojo.integral.IntegralGoodsSpec;
import cc.linker.steplink.crm.merchanth5.pojo.integral.IntegralSku;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface IntegralH5Dao {

    IntegralGoodsPo getIntegralGoodsInfo(@Param("goodsId") Long goodsId);

    List<IntegralGoodsSpec> getSpecByGoodsId(@Param("goodsId") Long goodsId);

    List<IntegralSku> getSkuByGoodsId(@Param("goodsId") Long goodsId);

    ShoppingCartGoodsPo checkShoppingGoodsOrder(Map<String, Object> param);

    int updateGoodsCount(@Param("goodsId") Long goodsId,@Param("goodsNum")  Integer goodsNum);

    void updateSkuGoodsCount(@Param("skuId") String skuId,@Param("goodsNum") Integer goodsNum);

    void insertOrderByMap(Map<String, Object> map);

    void insertOrderGoodsByMap(Map<String, Object> map);

    Integer checkOrderIfReceive(Map<String, Object> params);

    void checkReceiveOrder(Map<String, Object> params);

    void editOrderAddress(Map<String, Object> param);

    void addIntegralLog(Map<String, Object> log);

    List<Map<String, Object>> listLevels(Map map);

    int getBuyCountByGoodsId(@Param("goodsId") Long goodsId,@Param("customerId") String customerId);

    Map getSignGoodsInfo(Map param);

    Integer countTradeByPaySn(@Param("orderSn") String orderSn);

    List<Map<String, Object>> getOrderListByPaySn(@Param("orderSn") String orderSn);

    Integer getOrderIdByOrderSn(@Param("orderSn") String orderSn);

    void updateOrderInfo(@Param("wxtransactionId") String wxtransactionId,@Param("paymentState") Integer paymentState,
                         @Param("orderState") Integer orderState,@Param("orderSn") String orderSn);

    void updateIntegralOrderGoodsInfo(@Param("status") Integer status, @Param("orderId") Integer orderId);

    Integer getPayModeByOrgId(@Param("orgId") String orgId);

    String getOrderSnByOrderId(@Param("orderId") Long orderId);

    Integer getUnfreezeTimeByOrgId(@Param("orgId") String orgId);

    void updateProtectStatusWhereAutoConfirm(@Param("orderSn") String orderSn,@Param("unfreezeTime") String unfreezeTime);

    Map getOrderMapByOrderId(@Param("orderId") Integer orderId);

    List<Map<String, Object>> getOrderSnWhereAutoConfirm();

    List<Map<String, Object>> listOrderWhereNeedConfirm();

    void updateStatusWhereAutoConfirm(List<String> orderSnList);

    List<String> listOrderWhereExpired();

    void closeOrderWhereExpired(List<String> orderIds);

    List<Map<String, Object>> listOrderByOrderId(List<String> orderIds);

    void addMallGoodsCount(Map<String, Object> mapM);


    void addMallGoodsSkuCount(Map<String, Object> map);

    Map getOrderInfoById(@Param("orderId") Long orderId);

    List<Map> getGoodsIdsByOrderId(@Param("orderId")Integer orderId);

    void closeOrderByOrderId(@Param("orderId") Long orderId);

    Map<String, Object> orderByOrderId(@Param("orderId") Long orderId);

    String getAllOrderSnByOrderId(@Param("orderId") Long orderId);

    List<Map<String, Object>> getOrderInfoByPaySn(@Param("orderSn") String orderSn);

    Map<String, Object> getGoodsInfoByGoodsId(@Param("goodsId") String goodsId);

    Integer getVipListByCustomerId(@Param("customerId") String customerId,@Param("quotaVips")  String quotaVips);

    List<Map> getQuotaVipList(@Param("quotaVips") String quotaVips,@Param("customerId") String customerId);

    List<IntegralGoodsPo> getIntegralGoodsByIds(@Param("goodsIds") String goodsIds);

}
